function drawQCSF(logfrequency,pre,post,index,sgindex)
colors = [2 158 154; 255 189 7; 211 57 33]/255;
sg = {'Near distance', 'Far distance'};
m_t_pre = mean(pre);
m_t_post = mean(post);
se_t_pre = std(pre)/sqrt(8);
se_t_post = std(post)/sqrt(8);
colorindex = mod(index,3);
colorindex(colorindex == 0) = 3;
Ss = [8, 7, 8];
subrange = Ss(index);
for ss = 1:subrange
        subplot(1,3,index)
        p1 = plot(logfrequency,pre(ss,:),'-','color',colors(colorindex,:),'linewidth',0.2); hold on;
        p2 = plot(logfrequency,post(ss,:),'-','color',0.5*colors(colorindex,:),'linewidth',0.2); hold on;
        p1.Color(4) = .3;
        p2.Color(4) = .3;
        scatter(logfrequency,pre(ss,:),5,'o','markerfacecolor',colors(colorindex,:),'markeredgecolor','none','markerfacealpha',0,'linewidth',1); hold on;
        scatter(logfrequency,post(ss,:),5,'s','markerfacecolor',0.5*colors(colorindex,:),'markeredgecolor','none','markerfacealpha',0, 'linewidth',1); hold on;

        if ss == subrange
            plot(logfrequency,zeros(1,12),'--','color',[0.6 0.6 0.6],'linewidth',0.7); hold on
            ss1 = shadedErrorBar(logfrequency,m_t_pre,se_t_pre,colors(colorindex,:));
            set(ss1.edge, 'linestyle','none'); hold on;
            ss2 = shadedErrorBar(logfrequency,m_t_post,se_t_post,0.5*colors(colorindex,:));
            set(ss2.edge, 'linestyle','none'); hold on;
            if sgindex == 1
            legend([ss1.mainLine,ss2.mainLine],'Pre','Post','location','northeast')
            legend boxoff
            end
            xlabel('Log frequency','FontName', 'Arial', 'FontSize', 10, 'linewidth',1);
            box off
        end
        if index == 1
%             ylabel('Sensitivity erence', 'FontSize', 10);
            ylabel('Sensitivity', 'FontName', 'Arial','FontSize', 10, 'linewidth',1);
        end
        switch colorindex
            case 1; title('Alternating','FontName', 'Arial','FontSize',11,'fontweight','light', 'linewidth',1);
            case 2; title('Fixed','FontName', 'Arial','FontSize',11,'fontweight','light', 'linewidth',1);
            case 3; title('Control','FontName', 'Arial','FontSize',11,'fontweight','light', 'linewidth',1);
        end
        sgtitle(sg{sgindex},'FontName', 'Arial','FontSize',11,  'linewidth',1);
end 